<!-- <template> 
    <div class="app">
        <van-form @submit="onSubmit">
            <van-field v-model="username" name="username" placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]" />
            <van-field v-model="password" type="password" name="密码" label="密码" placeholder="密码"
                :rules="[{ required: true, message: '请填写密码' }]" />

            <van-field v-model="vercode" center clearable label="短信验证码" placeholder="请输入短信验证码">
                <template #button>
                    <van-button size="small" type="primary" native-type="button" @click="send">发送验证码dadadadadad</van-button>
                </template>
            </van-field>

            <div style="margin: 16px;">
                <van-button round block type="info" native-type="submit">提交</van-button>
            </div>
        </van-form>
        <tabars></tabars>
    </div>
</template>
<script>
export default {
    name: 'issue',
    components: {
        [tabars.name]: tabars
    },
    data() {
        return {
            username: '',
            password: '',
            vercode: '',
          
        };
    },
    
    mounted() {
    },
    created() {
      
    },
    methods: {
        onSubmit(values) {
            console.log('submit', values);
        this.getdl()

        },
        send(){
            let num=0
            let timer=setTimeout(() => {
                num++
            }, 1000);
  getLine('/user/sendSms',{ mobile: this.username, type: 'register' }).then(res => {
            console.log(res)
        })
        },
        getdl() {
            let { username, password, vercode } = this
            getLine('/user/reg', { password, username, vercode }).then(res => {
                console.log(res)
              
                if(res.code==0){
                      let {token}=res
                    localStorage.setItem('dw-token',token)
                }
            })
        },


    },
}
</script>
<style>
.app {
    padding: 30px;
}
</style> -->